Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mask off-detector slits/orders #1897

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open

Mask off-detector slits/orders #1897

wants to merge 4 commits into from

Conversation

debora-pe
Copy link
Collaborator

This PR adds the option to mask the portion of a slit/order that is more than 50% outside the detector. This is done, simply, by changing the values of specmin and specmax during slit tracing. This approach allows to avoid funny behaviors during the object extraction where the portion of the slit/order that is on the detector becomes smaller and smaller.

This masking is not done by default but a new parameter mask_off_detector has been introduced and it is set to True by default only for keck_hires.

Tests already run and pass. One unit test failure is my machine usual problem with setup_gui.
FAILED ../../../Pypeit/PypeIt-development-suite/unit_tests/test_setup_gui.py::test_pypeit_obslog_model - PermissionError: [Errno 1] Operation not permitted: '/private/var/folders/x...

Test Summary
--------------------------------------------------------
--- PYTEST PYPEIT UNIT TESTS PASSED  259 passed, 66 warnings in 378.61s (0:06:18) ---
--- PYTEST UNIT TESTS FAILED  1 failed, 151 passed, 168 warnings in 2057.03s (0:34:17) ---
--- PYTEST VET TESTS PASSED  66 passed, 124 warnings in 5591.32s (1:33:11) ---
--- PYPEIT DEVELOPMENT SUITE PASSED 250/250 TESTS  ---
Testing Started at 2025-02-04T17:08:54.523226
Testing Completed at 2025-02-05T11:08:37.776061
Total Time: 17:59:43.252835

Copy link
Collaborator

@kbwestfall kbwestfall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is some redundancy with other operations in edgetrace.py (look for places where we flag OFFDETECTOR and the trace_pixels_off_detector function), and I think I'd rather these checks be in check_synced instead of get_slits. I.e., ideally get_slits would just parse the EdgeTraceSet object into the SlitTraceSet one. But ... I think it's fine to leave it as is, particularly because it makes sense with the trim_spec stuff that precedes it.

Three minor requests:

  • I would change the text for the explanation of the mask_off_detector parameter to something like: "Mask spectral regions in each slit/order where more than 50% of the slit spatial coverage falls off the detector."
  • Add a comment in the release doc
  • Update the docs (ie., run make html and add any changed files).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants